#include <stdio.h>
#include <stdlib.h>

int main()
{
FILE *fp;
fp=fopen("r.dat","wb");
int n,num;
printf("enter n,num\n");
scanf("%d %d",&n,&num);
double *x,*y;
x=(double *)malloc(num*sizeof(double));
y=(double *)malloc(num*sizeof(double));
printf("enter x1 x2 ....n=%d\n",num);
int i=0;
for(i=0;i<num;i++)
{
scanf("%e",(x+num));
}
printf("enter y1 y2 ....n=%d\n",num);
for(i=0;i<num;i++)
{
scanf("%e",(y+num));
}
fwrite(&n,sizeof(n),1,fp);
fwrite(&num,sizeof(num),1,fp);
for(i=0;i<num;i++)
{
fwrite((x+num),sizeof(double),1,fp);
fwrite((y+num),sizeof(double),1,fp);
}
fclose(fp);
return 0;
}
